import {HTTP} from "../../utils/http";

const BASE_URL = "HomePage/"
const GET_STUDENT_DETAIL = BASE_URL + "get_student_details"
const GET_RE_STUDENT = BASE_URL + "recommend_student_list"
const GET_STUDENT_SUBJECT =  BASE_URL + "get_student_course"

class StudentModel extends HTTP{
    constructor() {
        super();

    }

    /**
     * 获取学生详情
     * @param stId
     * @returns {*|Promise|Promise<any>}
     */
    getStudentDetail(stId){

        return this.request({
            url: GET_STUDENT_DETAIL,
            data:{
                st_id : stId
            }
        })
    }


    /**
     * 获取相似学生
     * @param stId
     * @param current
     * @param pageSize
     * @returns {*|Promise|Promise<any>}
     */
    getRecommendStudent(stId,current,pageSize){
        return this.request({
            url: GET_RE_STUDENT,
            data:{
                st_id: stId,
                page: current,
                pagesize: pageSize
            }
        })
    }

    /**
     * 获取学生所学课程
     * @param stId
     * @param current
     * @param pageSize
     * @returns {*|Promise|Promise<any>}
     */
    getStudentSubject(stId,current,pageSize){

        return this.request({
            url: GET_STUDENT_SUBJECT,
            data:{
                st_id: stId,
                "page": current,
                "pagesize": pageSize
            }
        })
    }

}
export {StudentModel}